var yearvalue = document.date.year.options[document.date.year.selectedIndex].value;

function dateStart()
{
    //月份对应天数
    // MonHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

    //给年下拉框赋内容

    for (var i = 1917; i < 2023; i++)
        document.date.year.options.add(new Option(" "+ i , i));

    //给月下拉框赋内容
    for (var i = 1; i < 13; i++)
        document.date.month.options.add(new Option(" " + i , i));

    for (var i = 1; i < 32; i++)
        document.date.day.options.add(new Option(" " + i , i));


    //给年下拉框赋内容
    for (var i = 1917; i < 2023; i++)
        document.date.year2.options.add(new Option(" "+ i , i));

    //给月下拉框赋内容
    for (var i = 1; i < 13; i++)
        document.date.month2.options.add(new Option(" " + i , i));

    for (var i = 1; i < 32; i++)
        document.date.day2.options.add(new Option(" " + i , i));
}

if(document.attachEvent)
    window.attachEvent("onload", dateStart);
else
    window.addEventListener('load', dateStart, false);
